<?php if (!defined('THINK_PATH')) exit();?><!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<title>工作总结</title>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/Public/Admin/lib/html5.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/respond.min.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/PIE_IE678.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="/Public/Admin/lib/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/lib/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/lib/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/css/sty.css">
<link rel="stylesheet" type="text/css" href="/Public/css/page.css">
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<!--/meta 作为公共模版分离出去-->

<style type="text/css">
	.f-w{font-weight: bold;}
    /*.input-text{border: none !important}*/
    textarea{width: 95% !important}
    .textarea{height: 50px !important}
    /*td{font-size: 14px !important;border: none !important}
    .table-bordered th,table.dataTable{border-collapse: collapse !important;border: none !important }
    .table-bg thead th{background-color:#e9f3fc !important }*/
    .page-container{margin-bottom: 25px}
    /*button{margin-left: 20px }*/
    .bg-c,.normalEvenTD{
    background: #f5fafe;
    }
    .normalOddTD{
    background: #FFFFFF;
    }
    .table th,.table td{line-height: 20px !important;padding:8px !important;font-size:14px !important;}
    .table-bordered th, .table-bordered td{border-left: 1px solid #a0a0a0}
    .table-border th, .table-border td{border-bottom: 1px solid #a0a0a0}
    .table-bordered{border: 1px solid #a0a0a0}
    .b-le1{border-left: none !important}
    .breadcrumb{font-size: 12px !important}
</style>
</head>


<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 工作总结 <span class="c-gray en">&gt;</span> 工作总结列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <form action="<?php echo U('Work/index');?>" method="post">
            <div class="text-c">
                <?php if(($_SESSION['USER_AUTH']['oa_level']) == "2"): ?><!-- 销售经理用户  -->
                <!-- new 2017-03-07 -->
                    <select name="search_type" class="input-text" style="width:80px;padding-top:1px ">
                        <option value="all" <?php if(($search_type) == "all"): ?>selected<?php endif; ?> >全部</option>
                        <option value="my" <?php if(($search_type) == "my"): ?>selected<?php endif; ?> >我的</option>
                        <option value="xiashu" <?php if(($search_type) == "xiashu"): ?>selected<?php endif; ?> >下属</option>
                    </select><?php endif; ?>
                <input type="text" onfocus="WdatePicker()" id="logmin" name="date_begin" value="<?php echo ($date_begin); ?>" class="input-text Wdate" style="width:120px;" placeholder="请选择日期">
                -
                <input type="text" onfocus="WdatePicker()" id="logmax" name="date_end" value="<?php echo ($date_end); ?>" class="input-text Wdate" style="width:120px;" placeholder="请选择日期">
                <button class="btn btn-success radius" type="submit"><i class="Hui-iconfont">&#xe665;</i>搜索</button>
            </div>
        </form>
        <div class="cl pd-5 bg-1 bk-gray mt-20">
            <?php if(($_SESSION['USER_AUTH']['oa_level']) != "3"): ?><span class="l">
                    <a href="javascript:;" onclick="work_all_del()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
                    <a class="btn btn-primary radius"  style="text-decoration:none" class="ml-5"  onclick="work_html('添加总结','<?php echo U("Work/add");?>','10002')" href="javascript:;" title="添加总结"><i class="Hui-iconfont">&#xe600; </i>添加总结</a>
                </span><?php endif; ?>
            <span class="r digg">共有数据：<strong><?php echo ($count); ?></strong> 条</span>
            <!--<form action="<?php echo U('Work/index');?>" method="post">-->
            <!--    <div style="float:right" style="width:450px;">-->
            <!--        <?php if(($_SESSION['USER_AUTH']['oa_level']) == "2"): ?><!-- 销售经理用户  -->-->
            <!--            <select name="search_type" class="input-text" style="width:80px;">-->
            <!--                <option value="all" <?php if(($search_type) == "all"): ?>selected<?php endif; ?> >全部</option>-->
            <!--                <option value="my" <?php if(($search_type) == "my"): ?>selected<?php endif; ?> >我的</option>-->
            <!--                <option value="xiashu" <?php if(($search_type) == "xiashu"): ?>selected<?php endif; ?> >下属</option>-->
            <!--            </select>-->
            <!--<?php endif; ?>-->
            <!--        <input type="text" onfocus="WdatePicker()" id="logmin" name="date_begin" value="<?php echo ($date_begin); ?>" class="input-text Wdate" style="width:120px;">-->
            <!--        --->
            <!--        <input type="text" onfocus="WdatePicker()" id="logmax" name="date_end" value="<?php echo ($date_end); ?>" class="input-text Wdate" style="width:120px;">-->
            <!--        <button class="btn btn-success" type="submit" style="margin-left:10px;margin-right:10px;">搜索</button>-->
            <!--    </div>-->
            <!--</form>-->
        </div>
    	<div class="mt-20">
            <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper no-footer">

                <table class="list table table-border table-bordered table-bg table-hover table-sort dataTable no-footer">
                    <thead>
                        <tr class="text-c" role="row">
                            <th class="b-le1" width="25">
                                <input type="checkbox" name="" value="">
                            </th>
                            <th width="50">ID</th>
                            <th width="80">添加人</th>
                            <th style="width:auto">总结内容</th>
                            <th width="80">总结日期</th>
                            <th width="120">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php if(is_array($workList)): $i = 0; $__LIST__ = $workList;if( count($__LIST__)==0 ) : echo "$empty" ;else: foreach($__LIST__ as $key=>$val): $mod = ($i % 2 );++$i;?><tr class="text-c odd" role="row">
                                <td class="b-le1"><input type="checkbox" value="<?php echo ($val["id"]); ?>" class="check_box"></td>
                                <td><?php echo ($i+($p-1)*10); ?></td>
                                <td><?php echo (get_user_name($val["uid"])); ?></td>
                                <td>
                                    <div class="text-overflow" style="width:500px;margin:0px auto">
                                        <?php echo ($val["content"]); ?>
                                    <div>
                                </td>
                                <td><?php echo (date('Y-m-d',$val["date"])); ?></td>
                                <td style="text-align:left">
                                    <a style="text-decoration:none" class="ml-5" onclick="work_html('总结详情','<?php echo U("Work/detail",array("id"=>$val["id"]));?>','10002')" href="javascript:;">详情</a>
                                    <?php if($_SESSION['USER_AUTH']['oa_level']== 4): ?><!-- 管理员身份 -->
                                        <a style="text-decoration:none" class="ml-5" onclick="work_del('<?php echo U("Work/del",array("id"=>$val["id"],"p"=>$p));?>')" href="javascript:;">删除</a>
                                        <a style="text-decoration:none" class="ml-5" onclick="work_html('修改总结','<?php echo U("Work/edit",array("id"=>$val["id"]));?>','10002')" href="javascript:;">修改</a>
                                    <?php else: ?>  <!-- 添加人身份 -->
                                        <?php if(($_SESSION['USER_AUTH']['userid']) == $val["uid"]): ?><a style="text-decoration:none" class="ml-5" onclick="work_del('<?php echo U("Work/del",array("id"=>$val["id"],"p"=>$p));?>')" href="javascript:;">删除</a>
                                            <?php if(date('Y-m-d',$val['date']) == date('Y-m-d')): ?><a style="text-decoration:none" class="ml-5" onclick="work_html('修改总结','<?php echo U("Work/edit",array("id"=>$val["id"]));?>','10002')" href="javascript:;">修改</a><?php endif; endif; endif; ?>
                                </td>
                            </tr><?php endforeach; endif; else: echo "$empty" ;endif; ?>

                    </tbody>
                </table>
                <div class="manu"><?php echo ($page); ?></div>
            </div>
        </div>

</div>


<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/Public/Admin/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/static/h-ui.admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/My97DatePicker/WdatePicker.js"></script>
<!--/_footer /作为公共模版分离出去-->


<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">

// 新增 修改 详情
function work_html(title,url,id,w,h){
    layer_show(title,url,600,500);
}

// 删除
function work_del(url){
    layer.confirm('确认要删除吗？', {icon: 3, title:'删除'}, function(index){
        //$(obj).parents("tr").remove();
        layer.msg('已删除!',{icon:1,time:1000});
        window.location.href = url;
    });
}

// 批量删除
function work_all_del(){
    layer.confirm('确认要删除吗？', {icon: 3, title:'批量删除'},function(index){
        var wid = '';
        for (var i = $('.check_box').length - 1; i >= 0; i--) {
            if($('.check_box').eq(i).is(':checked')){
                wid = wid.length==0 ? $('.check_box').eq(i).val() : wid+','+$('.check_box').eq(i).val();
            }
        }
        if(wid.length == 0){
            layer.msg('请选择要删除的工作总结!',{icon:2,time:1000});
        }else{
            layer.msg('已删除!',{icon:1,time:1000});
            var url = "<?php echo U('Work/del',array('id'=>wid,'p'=>$p));?>";
            url = url.replace('wid',wid);
            window.location.href = url;
        }
    });
}



</script>

</body>
</html>